<me:UIICC_HR x:Class="WPFExcelReport.TICC_HRSTAMM"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:me="clr-namespace:WPFExcelReport"
                    xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                     xmlns:HR="clr-namespace:WPFExcelReport;assembly=THRSTAMM"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                     x:Name="TV" 
                    Loaded="Window_Loaded"
                    >
    <me:UIICC_HR.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:BoolToVisibilityConverter x:Key="bv"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>  
    </me:UIICC_HR.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Margin="10,10,10,10">
            <WrapPanel >
                 <Button    Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/search.png" />
                    </Button.Background>
                </Button>
              
                <Button    Click="EditCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/edit.png" />
                    </Button.Background>
                </Button>
                <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                    </Button.Background>
                </Button>
                <Button    Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/save.png" />
                    </Button.Background>
                </Button>
                <Button    Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/remove.png" />
                    </Button.Background>
                </Button>
                <HR:TEXHR/>
                <Button  Margin="10,0,0,0"   
                          Content="{Binding Source={Localization:Translate Word=重置流水号}}" Click="ResetSeq"/>
             </WrapPanel>
            <WrapPanel>
                <Button    Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/add.png" />
                    </Button.Background>
                </Button>
                <WrapPanel  Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}"> 
              
                <TextBlock Text="{Binding Source={Localization:Translate Word=新用户名}}"/>
                    <ex:TXT72 Text="{Binding KRS,ElementName=TV}" MaxLength="8" Width="100"/>
                <Button    Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                    </Button.Background>
                </Button>
                </WrapPanel>
            </WrapPanel>
            <WrapPanel>
                <TextBlock>ID</TextBlock>
                <TextBlock   HorizontalAlignment="Left" Margin="3" Text="{Binding Path=ROWNID}" VerticalAlignment="Center" Width="60" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=公司:}}"></TextBlock>
                <ex:TXT72  MaxLength="3" IsAutoClear="False"   HorizontalAlignment="Left" Margin="3" 
                                   Text="{Binding Path=COMPANY}" VerticalAlignment="Center" Width="80" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=用户ID:}}"></TextBlock>
                <ex:TXT72  MaxLength="8" IsAutoClear="False"    HorizontalAlignment="Left" Margin="3" 
                                   Text="{Binding Path=USERID}" VerticalAlignment="Center" Width="80" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=姓名:}}"></TextBlock>
                <ex:TXT72  MaxLength="40" IsAutoClear="False"   
                           Text="{Binding Path=EXCELFILE,Converter={StaticResource ResourceKey=gb2312}}" Width="120" />
                
                <TextBlock Text="{Binding Source={Localization:Translate Word=密码：}}"></TextBlock>
                <ex:TXT72  MaxLength="20" IsAutoClear="False"   Text="{Binding Path=PWD}" Width="100" />                
                <TextBlock Text="{Binding Source={Localization:Translate Word=手机：}}"></TextBlock>
                <ex:TXT72  MaxLength="40" IsAutoClear="False"   Text="{Binding Path=NETDRIVE}" Width="120" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=电话：}}"></TextBlock>
                <ex:TXT72  MaxLength="40" IsAutoClear="False"   Text="{Binding Path=ROOTDRIVE}" Width="120" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=邮箱}}"></TextBlock>
                <ex:TXT72  MaxLength="40" IsAutoClear="False"   Text="{Binding Path=UPDATER}" Width="150" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=地址}}"></TextBlock>
                <ex:TXT72  MaxLength="40" IsAutoClear="False"   Text="{Binding Path=CHECKFOLDER,Converter={StaticResource gb2312}}" Width="150" />
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <HR:THRITX IsAuto="True"  
                        IsEdit="{Binding IsEdit,ElementName=TV}"
                        IsSaved="{Binding IsSaved,ElementName=TV}"
                        ORDERNUM="{Binding KEY,ElementName=TV}"/>
        </StackPanel>
        <DataGrid  Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                              HeadersVisibility="Column"                           
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0,0,0,0" 
                              >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=MANDANT, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=客户端}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ROWNID, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=序列号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=HRSPRKZ, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=语言}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=COMPANY, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=公司}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=USERID, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=用户名}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=PWD, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=密码}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EXCELFILE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=姓名}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=DBSYSTEM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=数据库}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=NETDRIVE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=报表盘}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ROOTDRIVE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=根目录}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=CHECKFOLDER, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=核对目录树}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BYAGENT, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=按代理}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=UPDATER, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=更新器}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=IPADDRESS, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=服务地址}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=IPADDRESS2, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=服务地址2}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=NEWUSER, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=创建人}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=NEWTIME, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=CHGUSER, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=更改人}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=CHGTIME, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=日期}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid> 
    </Grid>
</me:UIICC_HR>
